<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html ng-app="">
	<head>
		<title>Controller</title>
		
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
		<script src="js/angular.min.js"></script>
	</head>
	<body>
		<div ng-controller="ipController">
		  <p>在输入框中尝试输入：</p>
		  <p>ip：<input type="text" ng-model="ipAdress"></p>
		  <button ng-click="setIpAdress()" >确认！</button>
			<script>
				function ipController($scope){
						
						$scope.setIpAdress = function(){
							alert($scope.ipAdress);
						}
						
						$scope.openSocket = function(){
							//打开事件
							w.onopen = function(){alert('连接已打开')}
							//接收数据通信事件
							w.onmessage = function(e){alert(e.data)}
							//关闭事件
							w.onclose = function(){alert('连接已关闭')}
						}
				}
			</script>
			
		
		</div>
	</body>
</html>